package com.itheima.system.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.itheima.system.pojo.oss.OOSProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/11/21 21:00
 */
@Configuration
public class OSSConfig {
    @Bean
    public OSS client(OOSProperties prop){
        return new OSSClientBuilder().build(prop.getEndpoint(), prop.getAccessKeyId(), prop.getAccessKeySecret());
    }
}
